package com.jinzecloud.reportapproval.service.impl;

import com.jinzecloud.reportapproval.dto.Param;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.Query;

import com.jinzecloud.reportapproval.mapper.ReportConditionMapper;
import com.jinzecloud.reportapproval.bean.ReportCondition;
import com.jinzecloud.reportapproval.service.ReportConditionService;


@Service("reportConditionService")
public class ReportConditionServiceImpl extends ServiceImpl<ReportConditionMapper, ReportCondition> implements ReportConditionService {

    @Override
    public PageUtils queryPage(Param param) {
        String pageSize = param.getPage();
        String limit = param.getLimit();
        String key = param.getKey();
        Map<String, Object> params = new HashMap<>();
        params.put("page",pageSize);
        params.put("limit",limit);
        IPage<ReportCondition> page = this.page(
                new Query<ReportCondition>().getPage(params),
                new QueryWrapper<ReportCondition>()
        );

        return new PageUtils(page);
    }

}